<?php
    defined('INDEX') or die ('Acesso direto n&atilde;o permitido');
    
    /**
     * The class to read and returns all configs defined in the config.php.
     * 
     * @author Carlos A. Junior
     */
	class Configuration
	{
		/**
		 * 
		 * @var _Config
		 */
		private $_config = null;
		
		public function __construct()
		{
			if(!class_exists('_Config'))
			{
				require_once (dirname(__FILE__)."/../../config.php");
			}
			
			$this->_config = new _Config();
		}
		
		/**
		 * Returns the database name.
		 * 
		 * @return string $database_name
		 */
		public function getDatabaseName()
		{
			return $this->_config->database;
		}
		
		/**
		 * Returns the database user.
		 * 
		 * @return string $database_user
		 */
		public function getDatabaseUser()
		{
			return $this->_config->usuario;
		}
		
		/**
		 * Returns the database user password.
		 * 
		 * @return string $database_password
		 */
		public function getDatabasePassword()
		{
			return $this->_config->senha;
		}
		
		/**
		 * Returns the database server address.
		 * 
		 * @return string $database_server
		 */
		public function getDatabaseServer()
		{
			return $this->_config->servidor;
		}
	}
?>